/**
 * 
 */
package org.insia.smartposse.metier.webservice;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.insia.smartposse.metier.ProjectSkill;
import org.insia.smartposse.metier.ProjectSkillAffectation;

/**
 * @author raguerri
 * @since 18 avr. 07
 * @version 0.0.1
 * 
 */
public class LightProjectSkill 
implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2639626014995412749L;
	private long id;
	private long project;
	private long skill;
	private double fee;
	private List<LightProjectSkillAffectation> affectations = new ArrayList<LightProjectSkillAffectation>();
	
	/**
	 * 
	 *
	 */
	public LightProjectSkill () {}
	
	/**
	 * 
	 * @param pskill
	 */
	public LightProjectSkill (ProjectSkill pskill) {
		id = pskill.getId();
		project = pskill.getProject().getId();
		skill = pskill.getSkill().getId();
		fee = pskill.getFee();
		
		if (pskill.getAffectations().size() != 0) {
			for (ProjectSkillAffectation pskilla : pskill.getAffectations()) {
				affectations.add(pskilla.setLight());
			}
		}
	}

	/**
	 * @return the affectations
	 */
	public List<LightProjectSkillAffectation> getAffectations() {
		return affectations;
	}

	/**
	 * @return the fee
	 */
	public double getFee() {
		return fee;
	}

	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @return the project
	 */
	public long getProject() {
		return project;
	}

	/**
	 * @return the skill
	 */
	public long getSkill() {
		return skill;
	}

	/**
	 * @param affectations the affectations to set
	 */
	public void setAffectations(List<LightProjectSkillAffectation> affectations) {
		this.affectations = affectations;
	}

	/**
	 * @param fee the fee to set
	 */
	public void setFee(double fee) {
		this.fee = fee;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @param project the project to set
	 */
	public void setProject(long project) {
		this.project = project;
	}

	/**
	 * @param skill the skill to set
	 */
	public void setSkill(long skill) {
		this.skill = skill;
	}
}
